package com.legendframework.core.cmd;

import com.legendframework.core.cmd.annotation.Command;
import com.legendframework.core.cmd.annotation.Cmd;
import com.legendframework.core.cmd.annotation.CmdParam;

import java.lang.reflect.Method;

public class CmdHelp {

    /**
     * 当前触发的指令方法
     */
    private Method cmdMethod;

    /**
     * 指令标题名称
     *
     * 取自指令方法上的注解
     * @see com.legendframework.core.cmd.annotation.Cmd#title()
     *
     * 如果title() 为空串，则取当前指令类上的注解
     * @see Command#title()
     *
     * 如果还是为空串，help()则取当前指令类的全限定类名，其他方法取方法名 ， 避免空串指令BUG，帮助排查原因
     */
    private String cmdName;

    /**
     * 指令
     *
     * 取自指令类上与方法上的注解的拼接
     * {@link Command#cmd()} + " " + {@link Cmd#value()}
     */
    private String[] cmd;

    /**
     * 指令参数
     */
    private CmdParam[] cmdParams;

    /**
     * 这个指令所需的权限名
     */
    private String PermissionStr;

    public Method getCmdMethod() {
        return cmdMethod;
    }

    public void setCmdMethod(Method cmdMethod) {
        this.cmdMethod = cmdMethod;
    }

    public String getCmdName() {
        return cmdName;
    }

    public void setCmdName(String cmdName) {
        this.cmdName = cmdName;
    }

    public String[] getCmd() {
        return cmd;
    }

    public void setCmd(String[] cmd) {
        this.cmd = cmd;
    }

    public CmdParam[] getCmdParams() {
        return cmdParams;
    }

    public void setCmdParams(CmdParam[] cmdParams) {
        this.cmdParams = cmdParams;
    }

    public String getPermissionStr() {
        return PermissionStr;
    }

    public void setPermissionStr(String permissionStr) {
        PermissionStr = permissionStr;
    }
}
